package com.cloudfun.campusshare.repo;

import com.cloudfun.campusshare.entity.DevicePropertyEntity;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.util.List;

/**
 * Created by Huqin on 2019/12/26
 */
public interface DevicePropertyRepo extends
        PagingAndSortingRepository<DevicePropertyEntity, String>,
        JpaSpecificationExecutor<DevicePropertyEntity> {

    DevicePropertyEntity findByDeviceIdAndPropertyName(String deviceId, String propName);

    DevicePropertyEntity findTopByDeviceIdOrderByUpdateTimeDesc(String deviceId);

    List<DevicePropertyEntity> findAllByDeviceId(String deviceId);

}
